#define _CRT_SECURE_NO_WARNINGS
#include<stdio.h>
#include<stdlib.h>
int distinctIntegers(int n) {
    int* a = malloc(n * sizeof(int));
    int x = n;
    int y = 1;
    a[0] = n;
    if (a != NULL) {
        for (int i = 0; i < y; i++) {
            if (y >= x) {
                int* new = realloc(a, x * 2 * sizeof(int));
                if (new != NULL)
                {
                    a = new;
                    x *= 2;
                }

            }
            for (int j = 1; j < a[i]; j++) {
                if (a[i] % j == 1)
                {
                    int p = 0;
                    for (int l = 0; l < y; l++)
                        if (a[l] == j)
                        {
                            p = 1;
                            break;
                        }
                    if (p == 0)
                        a[y++] = j;
                }
            }
        }
    }
    return y;
}
int main() {
    printf("%d", distinctIntegers(5));
}